package com.hd.platform.server.api.interceptor;

import com.hd.platform.server.api.log.LoggerFactory;
import org.slf4j.Logger;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by qingshengzheng on 16/7/11.
 */
public class ApiInterceptor  implements HandlerInterceptor {
    private Logger serverlogger= LoggerFactory.getServerInfoLogger(ApiInterceptor.class);
    private Logger apilogger=LoggerFactory.getApiInvokeLogger(ApiInterceptor.class);

    @Override
    public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) throws Exception {

        return true;
    }

    @Override
    public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception {
       httpServletResponse.setCharacterEncoding("UTF-8");


    }

    @Override
    public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception {

    }

    public void handleSign(HttpServletRequest httpServletRequest)
    {



    }


}
